package com.tiger.config;

import com.tiger.properties.MinioProperties;
import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author HuXuehao (StudiousTiger)
 * @desc 这个类的作用是
 * @date 2022/2/22
 */
@Configuration
public class MinioConfig {
    @Autowired
    private MinioProperties minioProperties;
    @Bean
    public MinioClient minioClient(){
        MinioClient minioClient = MinioClient.builder()
                .endpoint(minioProperties.getEndPoint())  // 服务器地址
                .credentials(minioProperties.getAccessKey(), minioProperties.getSecretKey()) // MINIO的用户名和密码
                .build();
        return minioClient;
    }
}
